package c.e.a.a.f.p.h;

import android.content.Context;
import b.i.b.f;
import c.e.a.a.f.h;
import c.e.a.a.f.n.e;
import c.e.a.a.f.n.g;
import c.e.a.a.f.n.m;
import c.e.a.a.f.p.i.c;
import c.e.a.a.f.q.b;
import c.e.a.a.f.r.a;
import java.util.ArrayList;
import java.util.concurrent.Executor;

/* compiled from: Uploader */
public class l {
    public final Context a;
    public final e b;
    public final c c;
    public final r d;
    public final Executor e;
    public final b f;
    public final a g;

    public l(Context context, e eVar, c cVar, r rVar, Executor executor, b bVar, a aVar) {
        this.a = context;
        this.b = eVar;
        this.c = cVar;
        this.d = rVar;
        this.e = executor;
        this.f = bVar;
        this.g = aVar;
    }

    public void a(h hVar, int i) {
        m a = this.b.a(hVar.b());
        Iterable<c.e.a.a.f.p.i.h> iterable = (Iterable) this.f.a(new h(this, hVar));
        if (iterable.iterator().hasNext()) {
            g a2;
            if (a == null) {
                f.m0("Uploader", "Unknown backend for %s, deleting event batch for it...", hVar);
                a2 = g.a();
            } else {
                ArrayList arrayList = new ArrayList();
                for (c.e.a.a.f.p.i.h a3 : iterable) {
                    arrayList.add(a3.a());
                }
                byte[] c = hVar.c();
                if (1 != 0) {
                    a2 = a.b(new c.e.a.a.f.n.a(arrayList, c, null));
                } else {
                    throw new IllegalStateException(c.b.a.a.a.D("Missing required properties:", ""));
                }
            }
            this.f.a(new i(this, a2, iterable, hVar, i));
        }
    }
}
